<!DOCTYPE html>
<html>

<head>
	<meta charset="utf-8">
	<title>套餐管理</title>
	<link rel="stylesheet" href="<?=adminassets?>assets/pear/component/pear/css/pear.css" />
</head>
<body class="pear-container">
    <?php if ($my == "list") : ?>
    <div class="layui-card">
			<div class="layui-card-body">
				<table id="news" lay-filter="news"></table>
			</div>
		</div>

		<script type="text/html" id="toolbar">
			<button class="pear-btn pear-btn-primary pear-btn-md" lay-event="add">
				<i class="layui-icon layui-icon-add-1"></i>
				新增
			</button>
		</script>


		<script type="text/html" id="status">
			<input type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="启用|禁用" lay-filter="status" {{# if(d.status==1){ }} checked {{# } }}>
		</script>

		<script type="text/html" id="options">
			<button class="pear-btn pear-btn-primary pear-btn-sm" lay-event="edit"><i class="layui-icon layui-icon-edit"></i></button>
			<button class="pear-btn pear-btn-danger pear-btn-sm" lay-event="remove"><i class="layui-icon layui-icon-delete"></i></button>
		</script>
    <?php endif; ?>	
    <?php if ($my == "add") : ?>
    <!-- 添加数据 -->
		<form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐名称
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="name"  value="" placeholder="必填"/>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐天数
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="days"  value="" placeholder="必填"/>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐额度
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="quota"  value="" placeholder="必填"/>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐价格
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="price"  value="" placeholder="必填"/>
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐介绍
						</label>
						<div class="layui-input-block">
							<textarea class="layui-textarea" id="add_news" name="introduce"></textarea>
						</div>
					</div>
				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="addSave">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
    <?php endif; ?>	
    <?php if ($my == "edit") : ?>
    <form class="layui-form" action="">
			<div class="mainBox">
				<div class="main-container">
				<input type="hidden" name="id"  value="<?=$id?>" />
				<div class="layui-form-item">
						<label class="layui-form-label">
							套餐名称
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="name"  value="<?=$row['name']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							VIP天数
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="days"  value="<?=$row['days']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐额度
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="quota"  value="<?=$row['quota']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐价格
						</label>
						<div class="layui-input-block">
							<input type="text" class="layui-input" name="price" value="<?=$row['price']?>" />
						</div>
					</div>
					<div class="layui-form-item">
						<label class="layui-form-label">
							套餐介绍
						</label>
						<div class="layui-input-block">
							<textarea class="layui-textarea" id="add_news" name="introduce"><?=$row['introduce']?></textarea>
						</div>
					</div>
				</div>
			</div>
			<div class="bottom">
				<div class="button-container">
					<button type="submit" class="layui-btn layui-btn-normal layui-btn-sm" lay-submit="" lay-filter="editSave">
						<i class="layui-icon layui-icon-ok"></i>
						提交
					</button>
					<button type="reset" class="layui-btn layui-btn-primary layui-btn-sm">
						<i class="layui-icon layui-icon-refresh"></i>
						重置
					</button>
				</div>
			</div>
		</form>
    <?php endif; ?>	
<script src="<?=adminassets?>assets/pear/component/layui/layui.js"></script>
<script src="<?=adminassets?>assets/pear/component/pear/pear.js"></script>
<script src="<?=adminassets?>assets/js/core_js/Package.js?v=<?=time()?>"></script>